
 import './index.scss'

import React from 'react'
export default class Banner extends React.Component{

    static getDerivedStateFromProps(nextProps){
        let {type} = nextProps
        let bannImg
        switch (type) {
            case 'case':
                bannImg = '/static/aboutImg/banner@2x.png'
                break;
            case 'contactGp':
                bannImg = '/static/aboutImg/contactGp.png'
                break;
            case 'news':
                bannImg = '/static/aboutImg/new_bg@2x.png'
                break;
            case 'service':
                bannImg = '/static/aboutImg/service.png'
                break;
            case 'about':
                bannImg = '/static/aboutImg/about_banner@2x.png'
                break;
            case 'caseDetails':
                bannImg = '/static/aboutImg/details.png'
                break;
        }
        return {
            bannImg
        }
    }

    constructor(props) {
        super(props);
        this.state = {}
    }
    render(){
        return (
            <div className='gp_banner'> 
                <img className='banner' src={this.state.bannImg} alt=""/>
            </div>
        )
    }
}